<!--
 Copyright 2010 Andrew Rickmann

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
<?php include('header.php'); ?>
<div id="content" class="prepend-top last">
    <div id="main-content" class="prepend-top span-18">
    <h1>How to check plugin dependencies</h1>
    <p>Waterwheel is heavily dependent on plugins, therefore it is highly likely that your plugin will depend on another plugin being loaded.</p>
    <p>The plugins class contains two functions that you can use to check dependencies, the first checks if a plugin is loaded: <code>is_loaded( classname )</code>, the second unloads a class if it should not be run: <code>unload( classname )</code></p>
    <p>The following example shows how you can check dependecies using these functions.</p>
    <?php

    //insert the code content from the sample file.
    $sample_file_content = file_get_contents( APPLICATION_PATH . '/plugins/gettingstarted/files/samples/dependencysample.txt'  );
    $geshi->set_source($sample_file_content);
    echo $geshi->parse_code();
    
    ?>
    <p><a href="<?php echo APPLICATION_PATH; ?>/plugins/gettingstarted/files/samples/dependecysample.txt">Download the sample file</a></p>
    </div>
    <?php include('plugintopics.php'); ?>
</div>
<?php include('footer.php'); ?>

